package com.dharma.mydiet.view;

import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.dharma.mydiet.R;
import com.dharma.mydiet.utility.Utils;
import com.google.analytics.tracking.android.EasyTracker;

public class StatisticsActivity extends Activity {

    private Button listado;
    private Button registro;
    private Button quality;
    private Button calories;
    private Button colesterol;
    private Button sugar;

    protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	this.setContentView(R.layout.activity_statisitics);
	int title = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");
	Utils.applyCustomFont((TextView) findViewById(title), getApplicationContext());
	ActionBar ab = getActionBar();
	ab.setSubtitle("Estadisticas");
	listado = (Button) findViewById(R.id.blistado);

	listado.setOnClickListener(new OnClickListener() {

	    @Override
	    public void onClick(View v) {
		Intent intent = new Intent(getApplicationContext(), ListadoRegistrosActivity.class);
		startActivity(intent);
	    }
	});
	registro = (Button) findViewById(R.id.graphicRegistries);

	registro.setOnClickListener(new OnClickListener() {

	    @Override
	    public void onClick(View v) {
		Intent intent = new Intent(getApplicationContext(), GraphicosRegistrosActivity.class);
		startActivity(intent);
	    }
	});

	quality = (Button) findViewById(R.id.graphicQuality);

	quality.setOnClickListener(new OnClickListener() {

	    @Override
	    public void onClick(View v) {
		Intent intent = new Intent(getApplicationContext(), GraphicosQualityActivity.class);
		startActivity(intent);
	    }
	});

	calories = (Button) findViewById(R.id.graphicCalorias);
	calories.setOnClickListener(new OnClickListener() {

	    @Override
	    public void onClick(View v) {
		Intent intent = new Intent(getApplicationContext(), GraphicosColesterolActivity.class);
		startActivity(intent);
	    }
	});

	colesterol = (Button) findViewById(R.id.graphicColesterol);
	colesterol.setOnClickListener(new OnClickListener() {

	    @Override
	    public void onClick(View v) {
		Intent intent = new Intent(getApplicationContext(), GraphicosCaloriesActivity.class);
		startActivity(intent);
	    }
	});

	sugar = (Button) findViewById(R.id.graphicSugar);
	sugar.setOnClickListener(new OnClickListener() {

	    @Override
	    public void onClick(View v) {
		Intent intent = new Intent(getApplicationContext(), GraphicosSugarActivity.class);
		startActivity(intent);
	    }
	});

    }

    @Override
    public void onStart() {
	super.onStart();
	EasyTracker.getInstance(this).activityStart(this); // Add this method.
    }

    @Override
    public void onStop() {
	super.onStop();
	EasyTracker.getInstance(this).activityStop(this); // Add this method.
    }
}
